﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;

namespace Acme.ShopStore.Shops
{
    public class GatherAppService: ApplicationService, IGatherAppService
    {

        public IRepository<Shop, Guid> _repository;

        public GatherAppService(IRepository<Shop, Guid> repository)
        {
            _repository = repository;
        }

        public bool GetList(string id)
        {
            var op = _repository.Where(s => s.Id.ToString().Equals(id)).FirstOrDefault();
            if (op.IsShows == true)
            {
                op.IsShows = false;
            }
            else
            {
                op.IsShows = true;
            }
            return op.IsShows;
        }
    }
}
